package net.chathu.airgw.packets.chat 
{
import air.update.utils.StringUtils;
import net.chathu.airgw.Config;
import net.chathu.airgw.model.Room;
import net.chathu.airgw.packets.gw.serverpackets.NoticePacket;
import net.chathu.airgw.util.StringUtil;
	/**
	 * ...
	 * @author ze
	 */
	public class IAddConfRooms extends ChatPacket 
	{
		
		public function IAddConfRooms() 
		{
			
		}
		
		override public function execute():void
		{
			var roomId:int = parseInt(data[2]);
			var inviteId:int= parseInt(data[9]);
			var modnum:int=0;
			var usernum:int = parseInt(data[5]);
			
			var topic:String = StringUtil.convertFromISO88591(data[7]);
			var name:String = topic;
			
			var room:Room = new Room(roomId, inviteId, name, topic, usernum, modnum, true, false);
			sessionData.chatData.rooms.add(room);
			sendToClient(new NoticePacket(Config.IRC_HOST, Config.GW_ECHO_NICK, "Sikeresen csatlakoztál a " + topic + " szobához. A szobák listájában " + room.name + " néven szerepel."));
		}
		
	}

}